package com.es.www.second.factory;

import com.es.www.second.CollegeHandler;
import com.es.www.second.DefaultPipeline;
import com.es.www.second.DepartmentHandler;
import com.es.www.second.Pipeline;
import com.es.www.second.SchoolHandler;

/**
 * @Created by michangtao
 * @Date 2022/5/25 13:31
 * @Description
 */
public class PipelineFactory {
    public static Pipeline getPipeline(){
        //设置头、尾节点
        Pipeline pipeline = new DefaultPipeline();
        //添加执行器
        pipeline.addLast(new DepartmentHandler("张主任"))
                .addLast(new CollegeHandler("王院长"))
                .addLast(new SchoolHandler("徐校长"));
        return pipeline;
    }
}
